<table class="mb10 col-md-12 table" style="text-align: left">
    <colgroup>
        <col width="200">
        <col width="200">
        <col width="220">
        <col width="220">
    </colgroup>
    <thead>
    <tr class="first_tr">
        <th>版本号</th>
        <th>销量</th>
        <th>售价</th>
        <th>安装</th>
    </tr>
    </thead>
    <tbody>
    <if condition="$data['uid'] eq is_login()">
        <tr>
            <td colspan="5">
                <a class="btn btn-success"
                   href="{:U('admin/addversion',array('id'=>$data['id']))}"
                   style="width: 100%">上传新版本</a>
            </td>
        </tr>
    </if>
    <volist name="versions" id="vo">
        <tr>
            <td class="text-left version_title">
                <a
                <if condition="check_auth('Appstore/Admin/manage',$data['uid'])">
                    href="{:U('appstore/admin/editVersion',array('id'=>$vo['id']))}"
                </if>
                class="version_title"> v {$vo.title}
                </a>
                <if condition="check_auth('Appstore/Admin/manage',$data['uid'])">
                    &nbsp;&nbsp;&nbsp;
                        <a class="text-danger" href="{:U('appstore/admin/editVersion',array('id'=>$vo['id']))}">编辑</a>&nbsp;&nbsp;
                        <a class="text-danger" href="{:U('appstore/admin/delVersion',array('id'=>$vo['id']))}">删除</a>
                </if>
            </td>


            <td>{$vo.sales}</td>
            <td class="text-left">{$vo.id|display_fee}</td>
            <td>{$vo.id|display_download}
            </td>
        </tr>
    </volist>
</table>
<div style="position: relative" class="clearfix">
    <div id="pageContent">
        <article>
        </article>
        <volist name="versions" id="vo">
            <section>
                <header>
                    <h3>v {$vo.title}
                        <small>{$vo.create_time|date='m-d H:i',###}</small>
                    </h3>
                </header>
                <article>
                    {$vo.log}
                </article>
            </section>
        </volist>
    </div>
</div>
<script>
    $(function () {
        $('.version_title').each(function () {
            var editUrl = $(this).attr('data-edit-url');
            var delUrl = $(this).attr('data-del-url');

            var editHtml = '';
            var delHtml = '';
            var flag = '';
            if (typeof editUrl != 'undefined') {
                editHtml = '<a href="' + $(this).attr('data-edit-url') + '">编辑</a>';
            }
            if (typeof delUrl != 'undefined') {
                delHtml = '<a href="' + $(this).attr('data-del-url') + '">删除</a>';
            }
            if (editHtml != '' && delHtml != '') {
                flag = ' | '
            }
            $(this).popover({content: editHtml + flag + delHtml, trigger: 'click', placement: 'left', html: true})
        })
    })
</script>